import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';

/// 圆角网络图片
class RoundedNetWorkImage extends StatelessWidget {
  final String url;
  final double size;

  const RoundedNetWorkImage(this.url, {Key key, this.size}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return CachedNetworkImage(
      imageUrl: url,
      width: size ?? 70,
      fit: BoxFit.cover,
      placeholder: (c, u) => Container(
        color: Colors.grey[200],
      ),
    );
  }
}
